<?php

use Illuminate\Support\Facades\Route;

Route::group(['middleware'=>'auth:web'], function (){
    Route::get("users", 'UserController@index');
    Route::get("users/data", 'UserController@data');
    Route::any("user/edit", 'UserController@edit');

    // 编辑当前登录用户信息
    Route::any("/edit-user","AdminUserController@edit");
    // 设置密码
    Route::any("/password","AdminUserController@password");
    // 首页
    Route::get("/","IndexController@index");
    Route::get("app/releases", 'AppController@releases');
    Route::get("app/get-releases", 'AppController@getReleases');
    // 获取导航菜单
    Route::get("/layInit","IndexController@layInit");
    Route::get("/layClear","IndexController@layClear");
    Route::any("app/create-release", 'AppController@createRelease');

    // 播放单个视频
    Route::get("video", 'VideosController@openVideo');

    Route::post('app/upload-package', 'AppController@uploadPackage');
    Route::any('app/release', 'AppController@release');

    Route::get("videos","VideosController@index");
    Route::get("videos/weight-list","VideosController@weightList");
    Route::get("videos/get-weight","VideosController@getTableDataWeight");
    Route::get("videos/get","VideosController@getTableData");

    Route::get("videos/batch-upload","VideosController@batchUpload");
    Route::post("videos/upload","VideosController@upload");
    Route::post("videos/delete","VideosController@delete");
    Route::get("videos/edit","VideosController@edit");
    Route::post("videos/edit","VideosController@update");

    Route::get("videos/edit-weight","VideosController@editWeight");
    Route::post("videos/edit-weight","VideosController@updateWeight");

    // 批量删除
    Route::post("videos/batch-delete","VideosController@batchDelete");
    // 批量推荐
    Route::post("videos/batch-recommend","VideosController@batchRecommend");
    // 批量取消推荐
    Route::post("videos/batch-cancel-recommend","VideosController@batchCancelRecommend");
    // 批量设置权重。新手视频库移动到普通视频 或反之
    Route::post("videos/batch-weight","VideosController@batchWeight");


});
if(config('app.env')!='production'){
    Route::get("register","IndexController@register")->name('register');
}

Route::get("login","IndexController@login")->name('login');

Route::any("test","IndexController@test");
